{include file="index@public/header" /}
<style>
    .xinlist{
        position: fixed;
        top: 5em;
        width: 100%;
    }
    .xinlist img{
        width:4em;
        height:4em;
    }
    .xinlist .neirong{
        padding:1em;
        border-bottom:1px dashed #bbb;
        color:#000;
    }
    .xinlist .neirong:last-child{
        border: none;
    }
    .xinlist .neirong div{
        line-height:4em;
    }
    .xinlist .cimd{
        color:#000;
        line-height:4em;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .xinlist .notice{
        color:#888;
    }
    .xinlist  .meibain{
        padding:0;
    }
</style>
<div class = "xinlist">
    <h4 class = "col-xs-12 text-center">{$meta_title}<i class = "fa fa-envelope-o" style = "padding-left:.5em;"></i></h4>
    {volist name="$model_list" id="list"}
    <a class = 'col-xs-12 neirong'  href = "{:url('index/oneself/lookxin',array('id'=>$list['Id']))}">
        <input type = "hidden" value = "{$list['Id']}" class = "thisId"/>
        <div class = "col-xs-3"><img src="{$list['touxiang']}" onerror="javascript:this.src='__PUBLIC__/images/login-img.jpg'" class = "img-circle"/></div>
        <div class = "col-xs-4 meibain cimd">{$list['username']}</div>
        <div class = "col-xs-3 meibain">{$list['shijian']}</div>
        <div class = "col-xs-1 pull-right" onClick="if(confirm('是否删除该条信息？')){shanchu($(this))}" ><i class = "fa fa-trash-o"></i></div>
    </a>
    {/volist}
    <div class = "col-xs-12 text-center notice"></div>
</div>
<script>
    if($('.neirong').length == 0){
        $('.notice').html('抱歉,暂无信件...');
    }
    var shanchu = function($data){
        $.ajax({
            type: "post",
            url: '/index/oneself/shanchu',
            data: {'thisId':$data.parent().find('.thisId').val()},
            dataType: 'json',
            success: function (data){
                if(data.code){
                    $.messager.show(data.msg, {placement: 'center',type:'success'});
                    $data.parent().remove();
                } else {
                    $.messager.show(data.msg, {placement: 'center',type:'failure'});
                }
            }
        });
    }
</script>
{include file="index@public/selfFooter" /}